<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //鸡肋
    class Person{
        kind = "人类"
        sayHello=function(){
            console.log("人类说了hello");
        }
    }
    //女人
    class Woman extends Person{
        constructor(name){
            super(name);
            this.name = name;
        }
        sing = function(){
            console.log("唱歌!!!");
        }
    }
    let lily = new Woman("莉莉");
    lily.sing();
    //男人
    class Man extends Person{
        constructor(name){
            super(name);
            this.name = name;
        }
        sex = "男"
        kongfu=function(){
            console.log("打功夫")
        }
    }
    let xiaoming = new Man("小明");
    xiaoming.sayHello();
    //人类说了hello
    console.log(xiaoming);
    //Man {kind: "人类", sex: "男", name: "小明", sayHello: ƒ, kongfu: ƒ}
    //原型链
    console.log(xiaoming.__proto__); //Person 
    //Person {constructor: ƒ}
    console.log(xiaoming.__proto__.__proto__); //Function
    //{constructor: ƒ}
    console.log(xiaoming.__proto__.__proto__.__proto__); //Object
    //{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …}
    console.log(xiaoming.__proto__.__proto__.__proto__.__proto__); //null
    //null
</script>
</html>